home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / m68k / cc68k.arc / GEN.H < prev    next >
C/C++ Source or Header  |  1986-09-01  |  2KB  |  48 lines

  1.  /*
  2.  *      code generation structures and constants
  3.  */
  4.  
  5. #define F_DREG  1       /* data register direct mode allowed */
  6. #define F_AREG  2       /* address register direct mode allowed */
  7. #define F_MEM   4       /* memory alterable modes allowed */
  8. #define F_IMMED 8       /* immediate mode allowed */
  9. #define F_ALT   7       /* alterable modes */
  10. #define F_DALT  5       /* data alterable modes */
  11. #define F_ALL   15      /* all modes allowed */
  12. #define F_VOL   16      /* need volitile operand */
  13. #define F_NOVALUE 32    /* dont need result value */
  14.  
  15. /*      addressing mode structure       */
  16.  
  17. struct amode {
  18.         char            mode;
  19.         char            preg;
  20.         char            sreg;
  21.         char            tempflag;
  22.         int             deep;           /* stack depth on allocation */
  23.         struct enode    *offset;
  24.         };
  25.  
  26. /*      output code structure   */
  27.  
  28. struct ocode {
  29.         struct ocode    *fwd, *back;
  30.         short           opcode;
  31.         short           length;
  32.         struct amode    *oper1, *oper2;
  33.         };
  34.  
  35. enum e_op {
  36.         op_move, op_moveq, op_add, op_addi, op_addq, op_sub, op_subi,
  37.         op_subq, op_muls, op_mulu, op_divs, op_divu, op_and, op_andi,
  38.         op_or, op_ori, op_eor, op_asl, op_asr, op_jmp, op_jsr, op_movem,
  39.         op_rts, op_bra, op_beq, op_bne, op_blt, op_ble, op_bgt, op_bge,
  40.         op_bhi, op_bhs, op_blo, op_bls, op_tst, op_ext, op_lea, op_swap,
  41.         op_neg, op_not, op_cmp, op_clr, op_link, op_unlk, op_label,
  42.         op_pea, op_cmpi, op_dc };
  43.  
  44. enum e_am {
  45.         am_dreg, am_areg, am_ind, am_ainc, am_adec, am_indx, am_indx2,
  46.         am_xpc, am_direct, am_immed, am_mask, am_none, am_indx3 };
  47.  
  48.